#lang racket

(define-struct posn (x y))

(define (rt a b)
  (sqrt
   (+ (sqr a)
      (sqr b)
      )
  )
  )

(define (distance-to-0 pos)
  (cond
    [(number? pos) pos]
    [(posn? pos) 
      (rt (posn-x pos) (posn-y pos))]
    )
  )

(distance-to-0 (make-posn 3 4))
(distance-to-0 15)